DISCUSSION
The
ATSUCreateMemorySetting function enables you to specify whether you wish to perform memory allocations yourself or have ATSUI do so. If you want to control memory allocation in ATSUI, pass
kATSUUseCallbacks in the
iHeapSpec parameter and a pointer to a
ATSUMemoryCallbacks union that contains pointers to your callback functions in the
iMemoryCallbacks parameter.
After creating a memory setting, you must pass it to the function
ATSUSetCurrentMemorySetting to ensure that it will be used in subsequent Memory Manager calls.
You might want to create different memory settings for different memory allocation operations. For example, you might create two different settings designating different heaps to use for allocating the memory associated with style and text layout object creation. Before creating a style or text layout object, you would then make the appropriate setting current by calling
ATSUSetCurrentMemorySetting.